<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<div class="navbar navbar-default" role="navigation">

    <div class="navbar-inner">
        <button type="button" class="navbar-toggle pull-left animated flip">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="/"> <img alt="Charisma Logo" src="/static/charisma/img/logo20.png" class="hidden-xs"/>
            <span>元数据平台</span></a>

        <!-- user dropdown starts -->
        <shiro:user>
        <div class="btn-group pull-right">
            <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                <i class="glyphicon glyphicon-user"></i><span class="hidden-sm hidden-xs">  <shiro:principal property="name"/></span>
                <span class="caret"></span>
            </button>
            <ul class="dropdown-menu">
                <li><a href="/user/profile.htm">个人资料</a></li>
                <li class="divider"></li>
                <li><a href="${ctx}/logout">退出登录</a></li>
            </ul>
        </div>
        </shiro:user>
        <!-- user dropdown ends -->

        <!-- theme selector starts -->
        <div class="btn-group pull-right theme-container animated tada">
            <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                <i class="glyphicon glyphicon-tint"></i><span
                    class="hidden-sm hidden-xs"> 切换  主题 / 皮肤</span>
                <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" id="themes">
                <li><a data-value="classic" href="#"><i class="whitespace"></i> 经典</a></li>
                <li><a data-value="cerulean" href="#"><i class="whitespace"></i> 蔚蓝</a></li>
                <li><a data-value="cyborg" href="#"><i class="whitespace"></i> 机械</a></li>
                <li><a data-value="simplex" href="#"><i class="whitespace"></i> 简单</a></li>
                <li><a data-value="lumen" href="#"><i class="whitespace"></i> 流光</a></li>
                <li><a data-value="slate" href="#"><i class="whitespace"></i> 深灰</a></li>
                <li><a data-value="spacelab" href="#"><i class="whitespace"></i> 太空</a></li>
                <li><a data-value="united" href="#"><i class="whitespace"></i> 艳红</a></li>
            </ul>
        </div>
        <!-- theme selector ends -->

        <ul class="collapse navbar-collapse nav navbar-nav top-menu">
            <c:forEach items="${mainMenus}" var="menu">
                <li <c:if test="${pageContext.request.requestURI eq menu.url}"> class="active" </c:if>>
                    <tags:permission url="${menu.url}"><a href="${ctx}${menu.url}">${menu.name}</a></tags:permission>
                </li>
            </c:forEach>
            <%--<li><a href="#"><i class="glyphicon glyphicon-globe"></i> Visit Site</a></li>--%>
            <%--<li class="dropdown">--%>
                <%--<a href="#" data-toggle="dropdown"><i class="glyphicon glyphicon-star"></i> Dropdown <span--%>
                        <%--class="caret"></span></a>--%>
                <%--<ul class="dropdown-menu" role="menu">--%>
                    <%--<li><a href="#">Action</a></li>--%>
                    <%--<li><a href="#">Another action</a></li>--%>
                    <%--<li><a href="#">Something else here</a></li>--%>
                    <%--<li class="divider"></li>--%>
                    <%--<li><a href="#">Separated link</a></li>--%>
                    <%--<li class="divider"></li>--%>
                    <%--<li><a href="#">One more separated link</a></li>--%>
                <%--</ul>--%>
            <%--</li>--%>
            <%--<li>--%>
                <%--<form class="navbar-search pull-left">--%>
                    <%--<input placeholder="Search" class="search-query form-control col-md-10" name="query"--%>
                           <%--type="text">--%>
                <%--</form>--%>
            <%--</li>--%>
        </ul>

    </div>
</div>


